import { HYRequest } from '../index.js'
import type {
  IAccount,
  IDataType,
  ILoginResult,
  IUserInfoResult,
  IUserMenusResult
} from './types.js'
enum LoginAPI {
  AccountLogin = '/home/multidata',
  UserInfoById = '/home/multidata'
}

export function accountLoginRequest(account: IAccount) {
  return HYRequest.get<IDataType<ILoginResult>>({
    url: LoginAPI.AccountLogin,
    data: account
  })
}

export function requestUserInfoById(id: number) {
  return HYRequest.get<IDataType<IUserInfoResult>>({
    url: LoginAPI.UserInfoById,
    data: {
      id
    }
  })
}
export function requestUserMenusByRoleId(id: string) {
  return HYRequest.get<IDataType<IUserMenusResult>>({
    url: LoginAPI.UserInfoById,
    data: {
      id
    }
  })
}
